Method for determining the starting instant of a periodically oscillating signal response

ABSTRACT

A method for determining the starting instant (t 0 ) of a periodically oscillating signal response (E 2 ; E 2 ′), wherein the signal response comprises a first set of half periods (E 2   a - d ; E 2   ′a - d ) having a polarity equal to a polarity of the first half period (E 2   a ; E 2   ′a ) in the signal response, and a second set of half periods (E 2   e - h ; E 2   ′e - h ) having a polarity opposite to the polarity of the first half period (E 2   a ; E 2   ′a ) in the signal response. 
     The method comprises the steps of: determining a peak half period (E 2   e ; E 2   ′f ) as the half period with the highest amplitude in a selected one of the first and second sets; determining a zero-crossing instant (ZC 1 ; ZC′ 1 ) of the signal response occurring a known time distance from the peak half period (E 2   e ; E 2   ′f ); determining the starting instant (t 0 ) of the signal response (E 2 ; E 2 ′) based on the zero-crossing instant (ZC 1 ; ZC′ 1 ) and a relationship between the peak half period (E 2   e ; E 2   ′f ) and the starting instant (t 0 ).

TECHNICAL FIELD

The present invention relates to a method for determining the startinginstant of a periodically oscillating signal response, a software forimplementation thereof, and a device utilizing such a method.

BACKGROUND OF THE INVENTION

Acoustic measurement systems exist in several variants and may be usedin many different areas, for example in measuring level or volume intanks, containers or similar, in measuring distance, in measuring offlow, in medical diagnostics, such as ultrasound examination, inposition determination etc.

An example is an echo type acoustic system for liquid level measurement.In such a system an acoustic transducer is typically provided at thehighest point in a container which contains the liquid, the level orvolume of which is to be measured. The acoustic transducer is fed from atransmitter with a first electric signal. In response to this firstsignal the transducer generates an acoustic pulse, typically in the formof an oscillating wave, which is transmitted downwards towards thesurface of the liquid. After reflection against the surface the pulse isagain picked up by the transducer which in response thereof generates asecond electric signal which is fed to a receiver. The time intervalbetween the first and the second electric signal, i.e. the transit timeof the acoustic pulse, is determined and the distance from thetransducer to the surface of the liquid can be calculated with aknowledge of the propagation velocity of the acoustic pulse in themedium in question.

Obviously in connection with such a transit time measurement it isimportant to be able to make an accurate determination of the time ofreception of the reflected pulse or echo.

US 2007/0186624 discloses an acoustic method for measuring a signalpropagation time in a medical liquid, where an oscillator-like receivedsignal is sampled during its first half-period and checked with the helpof a selection criterion based on the area enclosed between the restinglevel and the received signal during the half-period. When the result ofthis check is positive an intersection between the received signal andthe resting level is determined with the help of which the signaltransit time is calculated.

However, amplification or attenuation of the received signal typicallychanges as a function of temperature of the fluid in which acousticsignal propagates. This may cause erroneous measurements in applicationswhere the temperature is not stable.

In an effort to reduce measurement errors caused by temperature changes,U.S. Pat. No. 6,226,598 discloses a method where an ideal characteristicfirst period is defined, which is characterized by an ideal amplituderatio between the amplitudes of the two lobes of the idealcharacteristic first period. Then, for each period of a received soundsignal, the amplitudes of the two lobes of the period under examinationare determined, and a ratio of the amplitudes is compared to the idealamplitude ratio. If the result of the comparison is greater than athreshold value, the period under consideration is considered as beingnoise, whereas if the result of the comparison is less than thethreshold value, the zero-crossing between the two lobes is consideredto be the first zero-crossing of the received signal.

However, in some applications this method may be too computationallydemanding.

SUMMARY OF THE INVENTION

In view of the above, an object of the invention is to substantiallyovercoming at least some of the disadvantages of the prior art. Inparticular, an object is to provide a computationally efficient methodof determining the starting instant of a periodically oscillating signalresponse.

According to a first aspect of the invention, there is provided a methodfor determining the starting instant of a periodically oscillatingsignal response, wherein the signal response comprises a first set ofhalf periods having a polarity equal to a polarity of the first halfperiod in the signal response, and a second set of half periods having apolarity opposite to the polarity of the first half period in the signalresponse. The method comprises the steps of: determining a peak halfperiod as the half period with the highest amplitude in a selected oneof the first and second sets; determining a zero-crossing instant of thesignal response occurring a known time distance from the peak halfperiod; determining the starting instant of the signal response based onthe zero-crossing instant and a relationship between the peak halfperiod and the starting instant.

Note that the peak half period may be the half period that has thehighest amplitude in the first set of half periods even if there is ahalf period with a higher amplitude in the second set. Similarly, it maybe the half period that has the highest amplitude in the second set ofhalf periods even if there is a half period with a higher amplitude inthe first set. Thus, the peak half period is not necessarily the halfperiod in the signal response that has the highest amplitude (althoughit may be).

By periodically oscillating here should be understood that the signalresponse is essentially periodic in its nature, although there may be acertain variation in the duration of the half periods. In particular,there may be a gradual shift within the signal response such that thefirst half period has a longer duration, whereas the duration ofsubsequent half periods are gradually reduced.

The present invention is based on the understanding that a reliable wayto determine the starting instant of a periodically oscillating signalresponse is to find the peak half period (i.e. the half period of agiven polarity having the highest amplitude) and then utilize arelationship between the peak half period and the starting instant ofthe signal response to determine the starting instant.

An advantage with this approach is that the half period having thehighest amplitude in the selected set typically is easily detected (evenif there is noise present). Thus, the method may be utilized with lesssophisticated measurement equipment thereby enabling a cost-efficientsolution.

The relationship between the peak half period and the starting instantof the signal response may be known in advance. For example, the natureof the signal response may be such that the half period having thehighest amplitude is always the first half period in the second set.This allows a straight-forward and computationally efficient way todetermine the starting instant.

The method may further comprise the steps of: determining a ratiobetween an amplitude of a preceding half period and an amplitude of thepeak half period, wherein the preceding half period is the half periodimmediately preceding the peak half period in one of the first andsecond sets; comparing the ratio to a threshold value; and determiningthe number of half periods occurring between the peak half period andthe starting instant of the signal response based on the comparison,thereby determining the relationship between the peak half period andthe starting instant.

This enables an accurate measurement also in situations where therelationship between the peak half period and the starting instant isnot known in advance, such as when the signal response has beendistorted. An advantage is that since the method is less sensitive todistortion that may be caused by a change in Q-value of the transducerdue to changes in temperature a low cost transducer can be utilized.This enables a more cost-efficient measuring device.

The threshold value may be selected so as to distinguish oscillationsbelonging to the signal response from oscillations being noise. Thenoise may be random noise, interference noise, or noise related toechoes arising from disturbances in the wave propagation.

When the ratio is below the threshold value, an interpretation may bethat the peak half period is the half period in the selected setoccurring immediately after the starting instant of the signal response.This enables the relationship between the peak half period and thestarting instant to be established.

When the ratio is at least equal to (i.e. equal to or exceeds) thethreshold value, an interpretation may be that there is at least onehalf period in the selected set occurring between the peak half periodand the starting instant of the signal response.

According to an embodiment, the selected set is the second set of halfperiods. An advantage is that the amplitude of the half period havingthe highest amplitude in the second set typically is a larger than theamplitude of the half period having the highest amplitude in the firstset. Thus, the peak half period is more easily detected and themeasurement becomes less sensitive to noise.

According to an embodiment, the preceding half period belongs to theselected set. An advantage is that only one polarity needs to bedetected, thereby enabling a more cost efficient measuring device.

The zero-crossing instant may preferably be the zero-crossing instantoccurring immediately before or immediately after the peak half period,as detection of these are less sensitive to noise. However, it isrecognized that other zero-crossing instants may also be utilized.

The peak half period and/or the ratio between the amplitudes (i.e. theratio between the amplitude of the preceding half period and theamplitude of the peak half period) can be determined from a non-sampledrepresentation of the signal response. As no sampling is required thisenables a cost-efficient implementation and reduced power consumption.Furthermore, any inaccuracy that may be associated with the samplingprocedure is eliminated.

The peak half period can be determined by: detecting a set of timeperiods during which the amplitude of the signal response exceeds athreshold amplitude and has a polarity equivalent to the polarity of thehalf periods in the selected set; and interpreting the longest timeperiod in the set of time periods as corresponding to the peak halfperiod. For a non-sampled representation of the signal response it mayoften be convenient to use the time during which the amplitude of a halfperiod exceeds a given amplitude level as an indication of the amplituderather than trying to directly measure the amplitude of the half period.

The method may further comprise the steps of: interpreting the timeperiod which immediately precedes the longest time period in the set oftime periods as corresponding to the preceding half period; anddetermining the ratio between the amplitude of the preceding half periodand the amplitude of the peak half period based on the durations of theassociated time periods.

An advantage is that these steps are applicable for a non-sampledrepresentation of the signal response.

According to an embodiment, the peak half period may be determined byproviding the signal response to a circuit comprising an energy storagemedium; acquiring an output signal from said circuit, wherein saidoutput signal corresponds to a voltage over the energy storage medium;sampling the acquired output signal; selecting a set of samples, whereineach sample in said set of samples is associated with a different one ofthe half periods in the selected one of the first and second sets ofhalf periods and is detected at a predetermined occasion relative theassociated half period; and determining the half period which isassociated with the sample with the highest voltage as the peak halfperiod.

As the circuit typically is configured such that the voltage reductionof the energy storage medium is slower than the voltage variation of theperiodically oscillating signal response, the detected sample associatedwith a specific half period may be used as a direct indication of theamplitude of that half period. This enables a procedure that utilizessampled data while minimizing the required processing of data and thememory capacity consumed, thereby allowing a low cost micro computer tobe used. Furthermore, the less rapid voltage reduction means that areliable result can be achieved also for a low cost A/D-converter.

The ratio between the amplitude of the preceding half period and theamplitude of the peak half period may be determined by providing theperiodically oscillating signal response to a circuit comprising anenergy storage medium; acquiring an output signal from said circuit,wherein the output signal corresponds to a voltage over said energystorage medium; sampling the acquired output signal; selecting a sampleassociated with the preceding half period and a sample associated withthe peak half period; and determining the ratio between the amplitude ofthe preceding half period and the amplitude of the peak half period asthe ratio between the voltage of the sample associated with thepreceding half period and the voltage of the sample associated with theamplitude of the peak half period. The sample associated with thepreceding half period may be detected at a predetermined occasionrelative the preceding half period. Similarly, the sample associatedwith the peak half period may be detected at a correspondingpredetermined occasion relative the peak half period. An advantage isthat, due to a less rapid voltage reduction, a reliable result can beachieved also for a low cost A/D-converter.

The predetermined occasion relative the half period when the sample isdetected may be determined by determining a zero-crossing instant thatoccurs at the end of the half period; and detecting a sample that occursa predetermined time after the identified zero-crossing instant. Forexample, the next sample may be detected (i.e. the sample that occursimmediately after the zero-crossing).

A trigger signal used to generate the signal response may be configuredsuch that for an ideal signal response, the half period with the largestamplitude appears as early as possible. Preferably the first half periodin the second set of half periods is the half period with the largestamplitude.

An example of such a trigger signal would be a rectangular pulse havinga duration of about one half period. Alternatively, a rectangular pulsehaving a duration of two half periods can be used. Such a trigger pulsemay provide a signal response more suitable for detection according tothe present invention. In particular, the signal response resulting fromthe second half period of the trigger signal will serve to suppressparts of the signal response resulting from the first half period of thetrigger signal, thereby ensuring that the largest amplitude will appearearly in the signal response.

It is recognized by a person skilled in the art that other types oftrigger signals may also be used to generate a similar signal response.Thus, the shape of the pulse may vary. For example, a triangular pulseor a pulse having a rounded shape can be used. Furthermore the durationof the trigger signal may vary. Other examples of trigger signals wouldbe an impulse, step, or a chirp.

According to a second aspect of the invention there is provided asoftware for execution on a processing device that has programinstructions for implementation of the above described method.

According to a third aspect of the invention there is provided a devicefor acoustic measurement comprising: transducer means for transmittingand receiving a signal response; and a processing device arranged toperform the method according to the invention to determine the startinginstant of the received signal response.

The acoustic measurement device may further comprise a circuitcomprising an energy storing medium; and an analogue-to digitalconverter. An example of such a circuit would be a half-wave rectifier.

Other objectives, features and advantages will appear from the followingdetailed disclosure, from the attached dependent claims as well as fromthe drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The above, as well as additional objects, features and advantages of thepresent invention, will be better understood through the followingillustrative and non-limiting detailed description of preferredembodiments of the present invention, with reference to the appendeddrawings, where the same reference numerals will be used for similarelements, wherein:

FIG. 1 is a schematic illustration of an acoustic level measuringsystem.

FIG. 2 a schematically illustrates the principle appearance of a triggersignal.

FIG. 2 b-d schematically illustrates the principal appearance of asignal response, and associated time periods and zero-crossing instantsregistered by the control device.

FIG. 2 e-g schematically illustrates the principal appearance of anothersignal response, and associated time periods and zero-crossing instantsregistered by the control device.

FIG. 3 is a schematic block diagram illustrating a procedure fordetermining the starting instant of a periodically oscillating signalresponse.

FIG. 4 is a schematic block diagram illustrating another procedure fordetermining the starting instant of a periodically oscillating signalresponse.

FIG. 5 illustrates another signal response.

FIG. 6 illustrates yet another signal response.

FIG. 7 a schematically illustrates an alternative embodiment of theinvention where the control device comprises a half-wave rectifier andan ND-converter;

FIG. 7 b schematically illustrates an example of a half-wave rectifier;

FIG. 8 schematically illustrates an input signal supplied to thehalf-wave rectifier and a resulting output signal.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

FIG. 1, shows schematically an acoustic level measuring system accordingto an embodiment of the invention. The system may typically operatebelow ultra-sound (i.e. below 20 kHz). However, the method according tothe invention may also be applicable to systems operating at higherfrequencies (i.e. ultra-sound frequencies).

The acoustic level measuring system 100 comprises a transmitter-receiver102 which is electrically connected to an electro-acoustic transducer104 disposed at the top of a tube 106. The transducer 104 may beconstituted by a single unit, as shown in FIG. 1, or by a loudspeaker incombination with a microphone.

The tube 106 extends through the upper part of a container or tank 108which contains a liquid 110, the level of which in the container is tobe measured.

Furthermore, the transmitter-receiver 102 is connected to an electroniccontrol device 120, which is arranged to control thetransmitter-receiver 102 and to calculate the fluid level based on thesignal transmitted and received by the transmitter-receiver 102.

In operation, the acoustic transducer 104 receives at predeterminedintervals a first electric signal E1, also referred to as trigger signalE1, from the transmitter 102 and generates in response thereto anacoustic pulse P1, which is permitted to propagate through the tube 106to be reflected against the liquid surface 110 a, which is disposedabove the lower edge of the tube 106. A certain time after thetransmission, called the transit time of the pulse, the reflected pulseor echo P2 is received by the transducer 104, which transduces theechopulse P2 to a second electric signal E2 also referred to as signalresponse E2.

The electronic control device 120 receives the trigger signal E1, whichcauses the transmitted pulse P1, and also the response signal E2, whichis generated at the reception of the reflected pulse P2 and determinesthe transit time of the pulse from the two electric signals E1 and E2 toevaluate the fluid level.

FIG. 2 schematically illustrates the principle appearance of theelectric signals E1 and E2.

The trigger signal E1 received by the transducer is here a rectangularpulse with a duration of one half period and a negative polarity,whereas the resulting signal response E2 is a periodically oscillatingsignal having an essentially sinusoidal shape. The starting instant ofthe signal response E2 is indicated by t₀, and the first half period E2a in the signal response here has a negative polarity, i.e. the samepolarity as the trigger signal E1. However, it is recognized that thepolarity may be changed, for example, by switching the poles of thetransducer.

As illustrated in FIG. 2 b, the signal response E2 comprises a first setof half periods E2 a-d having a negative polarity, and a second set ofhalf periods E2 e-h having a positive polarity. Furthermore, the signalresponse E2 is typically preceded by noise N1 here in the form of smalloscillations.

The instants where the signal response E2 crosses the resting level 202(i.e. when the amplitude of the signal response is zero relative theresting level) are referred to as zero-crossing instants ZC1-ZC2. Theresting level is here assumed to be at 0V although it may also be offsetby a DC-voltage.

Unless the signal response E2 is somehow distorted (which will befurther discussed below in relation to FIG. 2 e), the rectangular pulseE1 will cause a signal response E2 where the first positive half periodE2 e is the positive half period in the signal response that has thehighest amplitude, whereas the amplitude of subsequent positive halfperiods E2 f-h will attenuate quickly, thereby creating a signalresponse having a distinct amplitude peak near the beginning of thesignal response. This undistorted signal is an example of an idealsignal response.

In order to accurately determine the transit time of the pulse theelectronic control device 120 typically utilizes the starting instant ofthe trigger signal E1 and the starting instant of the signal responseE2.

As is recognized by a person skilled in the art, determining thestarting instant of the trigger signal E1 is straight-forward and thuswill not be further discussed herein.

In order to determine the starting instant t₀ of the signal response E2,the electronic control device 120 comprises an amplifier 122, acomparator 124, and a processing device 126 with an associated memory128.

The comparator 124 is configured to detect when the amplitude of thesignal response E2 exceeds an amplitude threshold.

Here the comparator only detects when the amplitude of the signalresponse E2 exceeds a positive amplitude threshold (i.e. the negativehalf periods E2 a-d will not be evaluated here, although such anembodiment would be possible). It is recognized by a person skilled inthe art that the level of the amplitude threshold may vary depending onthe application. However, a typical value of the amplitude threshold maybe about 50% of the saturation voltage of the comparator.

The amplitude threshold 204 of the comparator 124 is shown in relationto the signal response E2 in FIG. 2 b. Here the first positive halfperiod E2 e and the second positive half period E2 f of the signalresponse exceeds the amplitude threshold 204 of the comparator, whereassubsequent half periods E2 g-h are below the amplitude threshold 204.Also the noise N1 is below the amplitude threshold 204 in theillustrated example.

The amplitude of the signal response E2 can be adapted by adjusting theamplification of the amplifier 122 arranged between the receiver 102 andthe comparator 124. Thus, it is possible to e.g. reduce theamplification so that only one (or none) of the positive half periodsexceeds the amplitude threshold or increase the amplification so thatmore than two positive half periods exceed the amplitude threshold.

The comparator 124 is connected to the processing device 126, whichregisters when a received signal has an amplitude exceeding theamplitude threshold 204. This information can then be stored in thememory 128.

The processing device 126 also has functionality to register when thereceived signal crosses the resting level 202, and store thisinformation in the memory 128.

In operation, as a signal response E2 is received by the receiver 102,the electronic control device 120 registers a set of time periodsrepresenting the intervals during which the amplitude of the receivedsignal E2 exceeds the positive amplitude threshold 204.

For the measurement situation shown in FIG. 2 b, two time periods T₁ andT₂ are registered by the control device as illustrated in FIG. 2 c. Herethe time period T₁ indicates the occurrence of half period E2 e, and thetime period T₂ indicates the occurrence of half period E2 f.

Furthermore, the electronic control device 120 registers a set ofzero-crossing instants ZC1-ZC2 for the signal response E2 as illustratedin FIG. 2 d.

A method for determining the starting instant of the signal response E2will now be described with reference to FIG. 2 and to the schematicblock diagram illustrated in FIG. 3.

Note that it is here assumed that the positive half period having thehighest amplitude in the signal response E2 is the first positive halfperiod E2 e.

First in step 301, a peak half period is determined as the positive halfperiod having the highest amplitude. The longest time period T₁registered by the control device 120 is here interpreted as anindication of the positive half period E2 e having the highestamplitude.

It can be noted that in some situation it may be convenient to adjustthe amplification of the amplifier 122 in a way that only the positivehalf period having the highest amplitude exceeds the amplitude threshold204 to facilitate identification of the peak half period.

Then in step 302, a zero-crossing instant of the signal responseoccurring a known time distance from the peak half period E2 e isdetermined. It may be preferable to utilize the zero-crossing instantoccurring immediately before or immediately after the peak half periodE2 e. However, other zero-crossing instants may also be used. Here, thezero-crossing instant ZC1 occurring immediately before the peak halfperiod E2 e is used.

In step 303, the starting instant t₀ of the signal response E2 is thendetermined based on the zero-crossing instant ZC1 and a relationshipbetween the peak half period E2 e and the starting instant t₀ of thesignal response. As it has here been assumed that the positive halfperiod having the highest amplitude in the signal response is the firstpositive half period E2 e, the peak half period E2 e is here perdefinition the first positive half period in the signal response. As thesignal response E2 starts with a negative half period, it is known thatthere will be one half period occurring between the peak half period E2e and the starting instant t₀ (i.e. the first negative half period E2a). Furthermore, as the zero-crossing instant ZC1 has been selected asthe zero-crossing instant occurring immediately before the peak halfperiod E2 e, it can be concluded that the starting instant t₀ of thesignal response occurs one half period before the zero-crossing instantZC1.

Assuming that the signal response is essentially sinusoidal the startinginstant can be calculated as:

${t_{0} = {t_{{ZC}\; 1} - \frac{T}{2}}},$where

t₀ is the starting instant of the signal response;

t_(ZC1) is the time of occurrence of the zero-crossing instant ZC1; andT is the time for one period of the oscillating signal response.

Although the above described method is applicable in a wide range ofsituations, there are situations where it may not be assumed that thepositive half period having the highest amplitude in the signal responseis the first positive half period.

For example, there are situations where the signal response E2 may bedistorted so that the peak half period no longer is the first positivehalf period. This is illustrated by the distorted signal response E2′ inFIG. 2 e where the positive half period having the highest amplitude isthe second positive half period E2′f.

Such a distortion may be caused for example by a change in Q-value ofthe transducer 104. The Q-value of the transducer may vary as a functionof temperature, especially for a low cost transducer. Thus, a distortionof the signal response may arise in applications where the temperatureis not stable.

It is recognized that if it is not known whether the peak half period isthe first or second positive half period in the signal response this maylead to a measurement error of one period thereby significantlydecreasing the measurement accuracy of the acoustic level measuringsystem.

In order to overcome this problem, the number of half periods occurringbetween the peak half period E2′f and the starting instant t₀ of thesignal response E2′ can be determined.

To do this a ratio between an amplitude of the positive half period E2′eimmediately preceding the peak half period and an amplitude of the peakhalf period E2′f is compared to a threshold value selected so as todistinguish oscillations belonging to the signal response fromoscillations being noise.

In a typical application the threshold value may be about 40%. However,the preferred threshold value may vary based on the magnitude of thenoise and on the magnitude of the distortion of the signal response.

For example, in applications where the expected distortion of the signalresponse is low, the threshold value can be set as high as 80% to reducethe risk that any noise is interpreted as being part of the signalresponse. A high threshold value may also be preferred if there is a lotof noise present.

On the other hand, under favourable conditions with little noise presentthe threshold value may be set as low as 15% or even 10%. A lowthreshold value enables a low-cost transducer (with a less stableQ-value) to be used, thereby enabling a more cost-efficient measurementdevice.

In some applications it may be convenient to determine the number ofhalf periods occurring between the peak half period E2′f and thestarting instant t₀ of the signal response E2′ by selecting theamplitude threshold 204 of the comparator 124 so that it coincides withthe threshold value. Thus, if there is a time period registered by thecomparator 124 which occurs before the time period associated with thepeak half period this time period will be the first positive halfperiod.

A method for determining the starting instant of the signal response E2′will now be described with reference to FIG. 2 e-g and to the schematicblock diagram illustrated in FIG. 4.

In this embodiment it is assumed that the amplitude threshold 204 of thecomparator 124 is set so as to coincide with the threshold value. It isalso assumed that the peak half period is the first or second positivehalf period in the signal response.

First in step 401, a peak half period is determined as the positive halfperiod having the highest amplitude. The longest time period T′₂registered by the control device 120 is here interpreted as anindication of the positive half period E2′f having the highestamplitude.

Then in step 402, the preceding half period is determined as thepositive half period immediately preceding the peak half period E2′f.The time period T′₁ which immediately precedes the longest time periodT′₂ is thus interpreted as an indication of the positive half periodE2′e immediately preceding the peak half period E2′f.

In step 403 a ratio between an amplitude of the preceding half periodand an amplitude of the peak half period is determined, and then in step404 this amplitude ratio is compared to a threshold value. However, inthis embodiment step 403 and 404 is not explicitly performed. As theamplitude threshold 204 of the comparator 124 is set so as to coincidewith the threshold value, the mere existence of the time period T′₁indicates that the preceding half period belongs to the signal response(whereas if no time period would be detected before the time period T′₂this would indicate that the peak half period would be the firstpositive half period in the signal response).

In step 405, a zero-crossing instant of the signal response occurring aknown time distance from the peak half period E2′f is determined. Here,the zero-crossing instant ZC′1 occurring immediately before the peakhalf period E2′f is used.

In step 406, the starting instant t₀ of the signal response E2′ is thendetermined based on the zero-crossing instant ZC′1 and a relationshipbetween the peak half period E2′f and the starting instant t₀. As it hasbeen determined in step 402 that that there is one positive half period(i.e. positive half period E2′e) occurring between peak half period E2′fand the starting instant t₀, it is known that there are three halfperiods (i.e. E2′a, E2′b and E2′e) occurring between the peak halfperiod E2′f and the starting instant t₀. Furthermore, as thezero-crossing instant has been selected as the zero-crossing instantZC′1 occurring immediately before the peak half period E2′f, it can beconcluded that the starting instant t₀ of the signal response occursthree half periods before the zero-crossing instant ZC′1.

Assuming that the signal response is essentially sinusoidal the startinginstant can be calculated as:

${t_{0} = {t_{{ZC}^{\prime}1} - {3 \cdot \frac{T}{2}}}},$where

t₀ is the starting instant of the signal response;

t_(ZC′1) is the time of occurrence of the zero-crossing instant ZC′1;and

T is the time for one period of the oscillating signal response.

In some applications there may be a variation in the duration of thehalf periods in the signal response (i.e. the time T is not constantthroughout the signal response). It is recognized by a person skilled inthe art that it is possible to compensate for such a variation.

Naturally the method also works for a signal response where the peakhalf period is the first positive half period. This can be understood bylooking at the signal response E2 illustrated in FIG. 2 b. In this casethere will be no time period registered before the longest time periodT₁ which is associated with the peak half period E2 e. Thus it is knownthat the peak half period E2 e is the first positive half period. Thestarting instant can then be determined by finding the zero-crossinginstant ZC1 immediately before the peak half period E2 e. The startinginstant t₀ of the signal response E2 will occur one half period beforethe zero-crossing instant ZC1.

According to an alternative embodiment, the amplitude threshold of thecomparator is lower than the threshold value, wherein step 403 and 404can be explicitly performed as described below with reference to FIG. 2e-g and FIG. 4.

In step 403, the ratio between the amplitude A_(prec) of the precedinghalf period E2′e and the amplitude A_(peak) of the peak half period E2′fis determined based on the durations of the associated time periods.

Assuming that the signal response E2′ is essentially sinusoidal, theamplitudes of the respective half period can be calculated by basictrigonometry.

In step 404, the ratio is then compared to the threshold value todetermine whether the preceding half period is part of the signalresponse, or should be considered to be noise. If the ratio exceeds thethreshold value, i.e.

${\frac{A_{prec}}{A_{peak}} \geq {threshold}},$the preceding half period is considered to belong to the signalresponse, if not the preceding half period is considered to be noise.

FIG. 5 illustrates a situation where the threshold amplitude 204 issufficiently low for noise N1 to be registered by the comparator. Insuch a situation a ratio is determined between an amplitude of apreceding half period N1 a (resulting from noise) and an amplitude ofthe peak half period E2 e. However, as the ratio is here below thethreshold value, the preceding half period N1 a will here be considerednot to be part of the signal response, and the peak half period E2 ewill be considered to be the first positive half period in the signalresponse.

The method according to the invention is also applicable when the peakhalf period is preceded by more than one positive half period by findingthe peak half period and then iteratively evaluating how many positivehalf periods that are situated between the peak half period and thestarting instant.

An example thereof will now be described with reference to FIG. 6. Heretwo positive half periods E2″e-f are situated between the peak half E2″gand the starting instant t₀.

First, the peak half period E2″g is determined. Then the ratio betweenthe amplitude of the preceding half period E21 and the peak half periodE2″g is determined. As this ratio exceeds the threshold value, thepreceding half E2″f is interpreted as a half period occurring betweenthe peak half period and the starting instant t₀. Next a ratio betweenan amplitude of a new preceding half period (here the positive halfperiod E2″e immediately preceding the most recently identified halfperiod E2″f) and an amplitude of the most recently identified halfperiod E2″f is determined. As the ratio between the amplitude of the newpreceding half period E2″e and the most recently identified half periodE21 exceeds the threshold value the new preceding half period E2″e isinterpreted as a half period occurring between the peak half period E2″gand the starting instant t₀. In the next iteration a ratio between theamplitude of the half period N1 a being noise and the amplitude of themost recently identified half period E2″e is determined. As this ratiois below the threshold value, the half period N1 a will be disregardedand the half period E2″e will be considered as the first positive halfperiod in the signal response. This also means that the iteration stops.

In embodiments where an amplitude ratio is calculated, the amplitudethreshold 204 of the comparator preferably is selected so as to achievea good indication of the amplitude of the evaluated half periods.

If the amplitude threshold is set too high (relative the amplitude ofthe evaluated half periods), there is a risk that the first positivehalf period in the signal response is not detected by the comparator. Onthe other hand, if the amplitude threshold is set too low (relative theamplitude of the evaluated half periods), a small change in timeregistered by the comparator will correspond to a relatively largechange in amplitude of the signal response (as the derivative of thesignal response is large close to the resting level and successivelygets smaller until it is about zero near the top of the half period).

To find an appropriate amplitude threshold a calibration procedure canbe performed when measuring is started and/or when the signal is lost.An example thereof as is described below with reference to FIG. 1 andFIG. 2 b.

As the calibration procedure is initiated the amplification of theamplifier 122 is low. A series of essentially identical trigger signalsE1 are then generated. For each trigger signal E1 a correspondingreceived signal response E2 is registered by the processing device 126.The processing device 126 controls the amplifier 122 by means of afeedback loop, and increases the amplification for each received signalresponse E2 until the amplitude of the positive half period having thehighest amplitude (here the peak amplitude E2 e) saturates thecomparator 124. In a typical application the saturation voltage of thecomparator 124 may be about 5V.

The amplitude threshold 204 is then set to about 50% of the saturationvoltage of the comparator, i.e. here about 2.5V.

FIG. 7 a schematically illustrates an alternative embodiment of theinvention. This embodiment differs from the previously describedembodiments in that the electronic control device 120 comprises acircuit 702 comprising an energy storage medium C, and ananalogue-to-digital (ND) converter 704 for sampling a signal acquiredfrom the circuit 702. As schematically illustrated in FIG. 7 b, thecircuit 702 may be a half-wave rectifier 702 comprising a diode 706, aresistor R1, and the energy storage medium C which is here a capacitorC.

The operation of the electronic control device 120 will now be describedwith reference to FIG. 7 a-b and FIG. 8. Here the input voltage V_(in)applied to the half-wave rectifier 702 is the signal response E2′.Further, it is here assumed that the capacitor C initially isdischarged.

FIG. 8 schematically illustrates the input voltage V_(in) applied to thehalf-wave rectifier 702 and the corresponding output voltage V_(ont)(which is here the voltage over the capacitor C) output by the half-waverectifier 702 as a function of time.

As the first positive half period N1 a (here being noise) is received bythe half-wave rectifier 702, the input voltage \f_(in) applied to thehalf-wave rectifier 702 is gradually increased, resulting in acorresponding increase in the output voltage V_(ont) of the half-waverectifier 702. The input voltage V_(in) also charges the capacitor C.Then, as the input voltage V_(in) is reduced (i.e. after the peak of thefirst positive half period N1 a) the capacitor C starts to discharge,and the output voltage V_(ont) of the half-wave rectifier 702 isreduced. However, as appears from FIG. 8, the voltage reduction of thesignal V_(ont) output by the circuit 702 is substantially slower thanthe voltage reduction of the signal response E2′.

Then, as the second positive half period E2′e is received by thehalf-wave rectifier 702, the input voltage V_(in) is again graduallyincreased and as the input voltage V_(in) exceeds the voltage over thecapacitor C, the capacitor starts charging again. Then, as the inputvoltage V_(in) is reduced (i.e. after the peak of the second positivehalf period E2′e) the capacitor C once again starts to discharge and theoutput voltage V_(out) again is reduced.

This procedure is then repeated for the subsequent positive half periodsE2′f-i.

The ND-converter 704 may typically be adapted to continuously sample thesignal V_(out) output by the half-wave rectifier at a predeterminedsampling frequency.

In order to determine the amplitude of each positive half period E2′e-i,the control device 120 may be configured to select a set of samples,wherein each sample (S_(N1a), S_(E2′e-i)) is associated with a differentone of the half period (N1 a, E2′e-i), and selected such that each ofthe selected samples is detected at a predetermined occasion relativethe half period in question. For example, the zero-crossing instant atthe end of the half period can be used to trigger the control device 120to store the next sample acquired from the A/D-converter 704 in a memory128. In the illustrated example, this results in samples, S_(N1′a),S_(E2′e) S_(E2′f), S_(E2′g), S_(E2′h), and S_(E2′i) as indicated in FIG.8. The peak half period E2′f can then be found as the positive halfperiod associated with the sample with the largest amplitude, i.e. herethe positive half period E2′f is the peak half period.

Note that, although the voltage of samples S_(E2′g), S_(E2′h), andS_(E2′i) are here higher than the voltage of the corresponding halfperiods E2′g-i of the signal response, an accurate result is achieved,since it suffice to determine that these subsequent half periods E2′g-iare lower than the previous half period E2′f.

After the peak half period E2′f has been determined, the startinginstant t₀ of the periodically oscillating signal E2′ can be determinedaccording to the procedure illustrated in FIG. 4. In doing so, thevoltage of the samples can be used to calculate the amplitude ratio. Forexample, the ratio between the amplitude of the preceding half periodE2′e and the amplitude of the peak half period E2′f can be determined asthe ratio between the voltage of the sample S_(E2′e) associated withpreceding half period E2′e and the voltage of the sample S_(E2′f)associated with the amplitude of the peak half period E2′f.

As is recognized by a person skilled in the art the rate of discharge ofthe capacitor C, and thus the rate at which the output voltage V_(out)of the half-wave rectifier is reduced can be adjusted by changing theresistance of the resistor R1 and/or the capacitance of the capacitor C.Since the output voltage V_(out) is used to compare different halfperiods or to calculate a ratio between different half periods, the rateat which the output voltage is reduced is typically not critical for thereliability of the procedure. Thus, the rate at which the output voltageis reduced may preferably be selected to be sufficiently rapid for asubsequent echo to be detected. Alternatively, the circuit may compriseanother (optional) resistor R2 that can be connected in parallel withthe resistor R1. Thus, by closing a switch 708 after an echo has beendetected the half-wave rectifier may be reset. The invention has mainlybeen described above with reference to a few embodiments. However, as isreadily appreciated by a person skilled in the art, other embodimentsthan the ones disclosed above are equally possible within the scope ofthe invention, as defined by the appended claims.

For example, although the above described comparator only detects halfperiods having a positive polarity it would be possible to have anarrangement where the comparator detects only half periods havingnegative polarity, or a comparator which detects half periods of bothpolarities.

Furthermore, in a situation where half periods of both polarities aredetected, a ratio between amplitudes of half periods having oppositepolarities may be determined and compared to a threshold value. Forexample, referring to FIG. 2 e, a ratio between the amplitude of halfperiod E2′f and the amplitude of half period E2′b may be determined andcompared to a threshold value when determining the number of halfperiods situated between the peak half period and the starting instantt₀.

Also a ratio between amplitudes of two negative half periods can bedetermined and compared to a threshold value when determining the numberof half periods situated between the peak half period and the startinginstant t₀.

Furthermore, for embodiments where sampling is used, it may be possibleto sample the signal response directly if the ND-converter has asufficiently high sampling frequency (i.e. the circuit with the energystorage medium may be omitted).

It is recognized that although the illustrated example shows awave-package propagating in a wave-guide, the invention is equallyapplicable to a wave-package propagating in free air.

The invention claimed is:
 1. A method for determining the startinginstant of a periodically oscillating signal response, wherein saidsignal response comprises a first set of half periods having a polarityequal to a polarity of the first half period in the signal response, anda second set of half periods having a polarity opposite to the polarityof the first half period in the signal response, said method comprising:determining, using an electronic control device, a peak half period asthe half period with the highest amplitude in a selected one of saidfirst and second sets; determining, using the electronic control device,a zero-crossing instant of said signal response occurring a known timedistance from said peak half period; determining the starting instant ofsaid signal response based on said zero-crossing instant and arelationship between said peak half period and said starting instant;wherein determining the relationship between said peak half period andsaid starting instant comprises: determining a ratio between anamplitude of a preceding half period and an amplitude of said peak halfperiod, wherein said preceding half period is the half periodimmediately preceding said peak half period in one of said first andsecond sets; comparing said ratio to a threshold value; and determiningthe number of half periods occurring between said peak half period andthe starting instant of the signal response based on said comparison. 2.A method according to claim 1, further comprising: when said ratio isbelow said threshold value, interpreting that said peak half period isthe half period in said selected set occurring immediately after saidstarting instant of the signal response.
 3. A method according to claim1, further comprising: when said ratio is at least equal to saidthreshold value, interpreting that there is at least one half period insaid selected set occurring between said peak half period and thestarting instant of the signal response.
 4. A method according to claim3, further comprising: interpreting that there is only one half periodin said selected set occurring between said peak half period and thestarting instant of the signal response.
 5. A method according to claim1, wherein said selected set is said second set of half periods.
 6. Amethod according to claim 1, wherein said preceding half period belongsto said selected set.
 7. A method according to claim 1, wherein thezero-crossing instant is the zero-crossing instant occurring immediatelybefore or immediately after the peak half period.
 8. A method accordingto claim 1, wherein said threshold value is selected so as todistinguish oscillations belonging to the signal response fromoscillations being noise.
 9. A method according to claim 1, wherein thepeak half period is determined by: providing said signal response to acircuit comprising an energy storage medium; acquiring an output signalfrom said circuit, wherein said output signal corresponds to a voltageover said energy storage medium; sampling the acquired output signal;selecting a set of samples, wherein each sample in said set of samplesis associated with a different one of the half periods in the selectedone of said first and second sets of half periods and is detected at apredetermined occasion relative the associated half period; anddetermining the half period which is associated with the sample with thehighest voltage as said peak half period.
 10. A method according toclaim 1, wherein the ratio between the amplitude of said preceding halfperiod and the amplitude of said peak half period is determined by:providing said signal response to a circuit comprising an energy storagemedium; acquiring an output signal from said circuit, wherein saidoutput signal corresponds to a voltage over said energy storage medium;sampling the acquired output signal; selecting a sample associated withsaid preceding half period and a sample associated with said peak halfperiod; and determining the ratio between the amplitude of the precedinghalf period and the amplitude of said peak half period as the ratiobetween the voltage of the sample associated with said preceding halfperiod and the voltage of the sample associated with the amplitude ofsaid peak half period.
 11. A method according to claim 9, wherein thepredetermined occasion relative the half period when the sample isdetected is determined by: determining a zero-crossing instant thatoccurs at the end of the half period; and selecting a sample that occursa predetermined time after the identified zero-crossing instant.
 12. Amethod according to claim 1, wherein a trigger signal used to generatethe signal response is configured such that for an ideal signal responsethe first half period in the second set of half periods is the halfperiod with the highest amplitude.
 13. A method according to claim 1,wherein at least one of the peak half period and the ratio between theamplitudes is determined from a non-sampled representation of saidsignal response.
 14. A method according to claim 13, wherein the peakhalf period is determined by: detecting a set of time periods duringwhich the amplitude of the signal response exceeds a threshold amplitudeand has a polarity equivalent to the polarity of the half periods in theselected set interpreting the longest time period in said set of timeperiods as corresponding to said peak half period.
 15. A methodaccording to claim 14, further comprising: interpreting the time periodwhich immediately precedes the longest time period in said set of timeperiods as corresponding to said preceding half period; and determiningthe ratio between the amplitude of said preceding half period and theamplitude of said peak half period based on the durations of theassociated time periods.
 16. A device for acoustic measurementcomprising: a transducer means for transmitting and receiving a signalresponse; and the electronic control device arranged to perform themethod of claim 1 to determine the starting instant of the receivedsignal response.